{% extends "module/common.html" %}
	{% block handle %}
    	var handle={
    		name:'表单',
    		serv:'htmlHandle'
    	};
    	  	          
    {% endblock %}
    {% block listhead %}
       //表格配置 begin head配置  属性 bindFunc,name,css,sortKey,sortByDefault,headcss
		var listHeadCfg={
			name:{name:'名称',css:{width:'10%'}},
			path:{name:'路径',css:{width:'10%'}},
			remark:{name:'备注',css:{width:'10%'}},
			rightId:{name:'权限ID',css:{width:'10%'}},
			formId:{name:'表单ID',css:{width:'10%'}},
			type:{name:'类型',css:{width:'10%'}},
			ctrl:{name:'操作',css:{width:'40%'},bindFunc:true}
		}
		//模板
		var renderTemplate=$("<div class='table_template'>"+
													"<div class='tr'>"+
															"<div class='td' jtext='name'></div>"+
															"<div class='td' jtext='path'></div>"+													
															"<div class='td' jtext='remark'></div>"+
															"<div class='td' jtext='rightId'></div>"+
															"<div class='td' jtext='formId'></div>"+
															"<div class='td' jtext='type'></div>"+
															"<div class='td' jtext='ctrl'></div>"+										
													"</div>"+
												"</div>");
    {% endblock %}
    {% block listfunc %}
		tableHandle.addFunc("ctrl",function(){
			return $(
			"<button class='btn' callFunc='click:treeForm'>树形表单</button>"+
			"<button class='btn' callFunc='click:editTemplate'>编辑</button>"+
			"<button class='btn' callFunc='click:delTemplate'>删除</button>");
		},body);		
                    
        yanhx.addFunc("editForm",function(){
			var data=tableHandle.exec({
				table:body,
				func:'getRowData',
				data:$src()
			});
			top.yanhx.exec("tabHandle.openTabFromCurTab",{
				tabKey:'editForm'+data.id,
				tabName:data.remark+'(定义表单)',
				tabSrc:'/do?action=htmlHandle.editForm&id='+data.id
			});
		});	
		yanhx.addFunc("treeForm",function(){
			var data=tableHandle.exec({
				table:body,
				func:'getRowData',
				data:$src()
			});
			top.yanhx.exec("tabHandle.openTabFromCurTab",{
				tabKey:'treeForm'+data.id,
				tabName:data.remark+'(定义表单)',
				tabSrc:'/do?action=htmlHandle.treeForm&id='+data.id
			});
		});	       			
	{% endblock %}	
	{% block other %}
       
    {% endblock %}    		
			